const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// user 模型==> users集合
const UserType = {
  name: {
    type: String,
    required: true,
  },
  email: {
    type: String,
    required: true,
  },
  password: {
    type: String,
    required: true,
  },
  avatar: {
    type: String,
  },
  identity: {
    type: String,
    required: true,
  },
  date: {
    type: Date,
    default: Date.now(),
  },
};
const UserModel = mongoose.model("users", new Schema(UserType));
module.exports = UserModel;
